package com.lance.payroll.app;

import com.lance.payroll.Payable;
import com.lance.payroll.impl.Date;
import com.lance.payroll.impl.Invoice;
import com.lance.payroll.impl.SalariedEmployee;

public class PayableInterfaceTest
{

    public static void main(String[] args)
    {
        Payable[] payableObjects = new Payable[4];

        payableObjects[0] = new Invoice("01234", "seat", 2, 375.00);
        payableObjects[1] = new Invoice("56789", "tire", 4, 79.95);
        payableObjects[2] = new SalariedEmployee(800.00, "John", "Smith", "111-11-1111", new Date(2, 4, 1990),new Date(6, 20, 2001));
        payableObjects[3] = new SalariedEmployee(1200.00, "Lisa", "Barnes", "888-88-8888", new Date(9, 8, 1989), new Date(7, 5, 2003));

        System.out.println("Invoices and Employees processed polymorphically:\n");

        for (Payable currentPayable : payableObjects)
        {
            System.out.printf("%s \n%s: $%,.2f\n\n",
                    currentPayable.toString(),
                    "payment due", currentPayable.getPaymentAmount());
        }
    }
}